The present invention relates generally to the field of translations, and more particularly to translating SPARQL query to a semantically equivalent SQL.
SPARQL Protocol and RDF Query Language (SPARQL) is a Resource Description Framework (RDF) query language, that is, a semantic query language for databases, able to retrieve and manipulate data stored in RDF format. RDF is a family of specifications originally designed as a metadata data model. SPARQL allows for a query to consist of triple patterns: conjunctions, disjunctions, and optional patterns. Triple patterns for the purpose-built database for storage and retrieval of triples through semantic queries. A triple is a data entity composed of subject-predicate-object. In a RDF model the data is represented as triples wherein the subject is the matter in concern and the object is the description for the matter to the relationship specified by a predicate. Given data of a particular domain when represented as a RDF model can be visualized as a connected graph.
Structured Query Language (SQL) is a special-purpose programming language designed for managing data held in a relationship database management system (RDBMS), or for stream processing in a relationship data stream management system (RDSMS). The RDF model that can be visualized as a connected graph can be persisted in different formats and on different storage systems. One of the repositories of persistence is a RDBMS. Thus the RDF model in the SPARQL language needs to be translated to SQL so that the data retrieved from the database is as expected by the issued SPARQL query.